form-event.js ➔ formEvent   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 19
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 19
rs 9.8
c 0
b 0
f 0
cc 2
1
// formToObject
2
function formEvent(form, rest_form, error, success) {
0 ignored issues
show
Unused Code introduced by
The parameter error is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
The parameter success is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
3
    console.log(form);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
4
5
    form.addEventListener("submit", function (event) {
6
        console.log(this);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
7
8
        var data = formToObject(this);
9
        var method = data.method;
10
        delete data.method;
11
        delete data.submit;
12
13
        console.log(method);
14
15
        rest_form.byMethod(method, data);
16
        console.log(data);
17
18
        event.preventDefault();
19
    });
20
}
21